package org.wxd.category.spi;

import java.util.List;
import java.util.Optional;

/**
 * Created by wangxd on 2015/11/12.
 */
public interface CategoryOperations {

    /**
     * @param id
     * @return
     */
    Optional<Category> ofId(String id);

    /**
     * @param pId
     * @return
     */
    Optional<Category> ofParentId(String pId);

    /**
     * @return
     */
    List<Category> list();

    /**
     * @param category
     * @return
     */
    Category store(Category category);

    /**
     * @param category
     * @return
     */
    Category remove(Category category);
}
